Hierarchical clustering of networks